package com.example.mq.mqsever.core;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-08-20
 * Time: 19:48
 */
public class BasicProperties implements Serializable {
   //消息的唯一身份标识,保证唯一id,使用UUID作为id
    private String messageId;
    //当前交换机为TOPIC,这个routingKey就是出的题的答案,相互对应了才能转发到对应的队列
    //当前交换机为FANOUT,那么routingKey就不写了
    //如果当前交换机为DIRECT,那么routingKey就表示要转发给的队列名
    //
    private String routingKey;
    //表示消息队列是否要持久化,=1不持久化,=2持久化
    private  int deliverMode=1;

    @Override
    public String toString() {
        return "BasicProperties{" +
                "messageId='" + messageId + '\'' +
                ", routingKey='" + routingKey + '\'' +
                ", deliverMode=" + deliverMode +
                '}';
    }

    //其实针对RabbitMQ还有很多方法,其他属性先不考虑了

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public void setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
    }

    public int getDeliverMode() {
        return deliverMode;
    }

    public void setDeliverMode(int deliverMode) {
        this.deliverMode = deliverMode;
    }
}
